#ifndef __LA_XSYS_H__
#define __LA_XSYS_H__

typedef  long long  CstTBValue;

typedef   struct
{
    unsigned int HardSample;
    unsigned int SoftSample;
    unsigned int Insert;
}CstTBSysInfo;

typedef   struct
{
    const CstTBValue Value;
    CstTBSysInfo Sram;
    CstTBSysInfo SecBuff;
}CstTB;

typedef   struct
{
    short TimeBase;
    long PreTrgDepth;
    long PreTrgDepth0;
}CstLaAcqSys;


#define LEV1NS        0
#define LEV2NS        1
#define LEV5NS        2
#define LEV10NS        3
#define LEV20NS        4
#define LEV50NS        5
#define LEV100NS        6
#define LEV200NS        7
#define LEV500NS        8
#define LEV1US        9
#define LEV2US        10
#define LEV5US        11
#define LEV10US        12
#define LEV20US        13
#define LEV50US        14
#define LEV100US        15
#define LEV200US        16
#define LEV500US        17
#define LEV1MS        18
#define LEV2MS        19
#define LEV5MS        20
#define LEV10MS        21
#define LEV20MS        22
#define LEV50MS        23
#define LEV100MS        24
#define LEV200MS        25
#define LEV500MS        26
#define LEV1S        27
#define LEV2S        28
#define LEV5S        29
#define LEV10S        30
#define LEV20S        31
#define LEV50S        32
#define LEV100S        33
#define LEV200S        34
#define TBLEVMAX    LEV50MS
#define TBLEVMIN        LEV2NS

#define PixelXDIV                                    50

#define LA_MAX_SAMPLS                            250000000UL
#define SysClockCyc                                (int)(1000000000ULL/LA_MAX_SAMPLS)



void InitTBStruct(void);

CstTBValue LAGetDispSampleRatio(short timebase);

CstTBValue LAGetDispSampleTime(short timebase);

int  LAClacXSystemParameter(short timebase,CstTBSysInfo*pTBSysInfo,int BuffLen);

int  LAGetSramHWSample(short timebase);


int  LAGetSramSWSample(short timebase);

int  LAGetSramInsert(short timebase);

int LAGetRTSampleRatio(short timebase);

int LAGetSecSampleRatio(short timebase);

long LAGetSramAcqCyc(short timebase);

short LAGetAcqTimeBase(void);

void LASetAcqTimeBase( short TimeBase);

long LAGetPreTrgDepth(void) ;

void LASetPreTrgDepth(long Depth) ;

long LAUpdateTrgDepth(short timebase);

long LAGetTrgDepth(short timebase);

void GetXOrgSampleBound(CstSecBuff*pSec);

void LAXProcess(void);


extern "C" CstLaAcqSys XSys;


#endif
